<!DOCTYPE html>
<html xmlns:ui='http://java.sun.com/jsf/facelets'
	xmlns:h='http://java.sun.com/jsf/html'
	xmlns:f='http://java.sun.com/jsf/core' lang='en'>
<body>
<ui:composition template='snippets/template.xhtml'>
	<ui:define name='title'>Controll Unit</ui:define>
	<ui:define name='content'>
		<f:view>
		<h:form id='controllerUnitForm'>
			<h:dataTable id="units" value="#{  ControllerUnitBean.units }" var="unit">
				<h:inputHidden id="measurandName" value="#{ unit.measurandName }" />
				<h:inputHidden id="unitId" value="#{ unit.unitId }" />
				<h:inputHidden id="owner" value="#{ unit.owner }" />
				
				<h:column>
					<h:selectBooleanCheckbox value="#{ unit.selected }" />
				</h:column>
				
				<h:column>
					<f:facet name="header">
						<h:outputText value="Name" />
					</f:facet>
					<h:inputText id="name" value="#{unit.name}" />
				</h:column>

				<h:column>
					<f:facet name="header">
						<h:outputText value="Symbol" />
					</f:facet>
					<h:inputText id="symbol" value="#{unit.symbol}">
					</h:inputText>
				</h:column>

				<h:column>
					<f:facet name="header">
						<h:outputText value="Divisor" />
					</f:facet>
					<h:inputText id="divisor" value="#{unit.divisor}">
						<f:convertNumber maxFractionDigits="30" />
					</h:inputText>
				</h:column>

				<h:column>
					<f:facet name="header">
						<h:outputText value="Shift" />
					</f:facet>
					<h:inputText id="shift" value="#{unit.shift}" />
				</h:column>
			</h:dataTable>
			<br />
			<br />
			<h:commandButton id="voteLink" action="#{ ControllerUnitBean.vote }" disabled="true" value="Zur Veröffentlichung vorschlagen" />
			<h:outputText value="&#160;" />
			<h:commandButton id="deleteLink" action="#{ ControllerUnitBean.delete }" value="Löschen" />
			<h:outputText value="&#160;" />
			<h:commandButton id="saveButton" action="#{ ControllerUnitBean.save }" value="Speichern" />
			</h:form>
		</f:view>
	</ui:define>
</ui:composition>
</body>
</html>